#include "widget.h"
#include "ui_widget.h"

#include<QPushButton>
#include<QFont>


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    buttoon =new QPushButton(this);
    buttoon->setText("按钮");
    buttoon->move(100,100);

    connect(buttoon,&QPushButton::clicked,this,&Widget::hand);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::hand()
{
    if(buttoon->text()==QString("按钮"))
    {
        buttoon->move(200,200);
    }
    else {
        buttoon->move(100,100);
    }
}

